/*!
  @file io.h
  @copyright 2013 Kubota Lab. All rights resereved.
*/

#ifndef _KCV_IO_H_
#define _KCV_IO_H_

#include <iostream>

//-- debug messages
// define the macro MODULE_NAME before including this file
#define INFO(...) {\
  std::cout << "[INFO:" << MODULE_NAME << "]"; \
  do { std::cout << "  " << __VA_ARGS__; } while(0); std::cout << std::endl; }

#define DEBUG(...) \
  if (DEBUG_FLAG) { \
    std::cout << "[DEBUG:" << MODULE_NAME << "]"; \
    do { std::cout << "  " << __VA_ARGS__; } while(0); std::cout << std::endl; \
  }

#define WARN(...) \
  std::cout << "[WARN:" << MODULE_NAME << "]"; \
  do { std::cout << "  " << __VA_ARGS__; } while(0); std::cout << std::endl

#define ERROR(...) \
  std::cout << "[ERROR:" << MODULE_NAME << "]"; \
  do { std::cout << "  " << __VA_ARGS__; } while(0); std::cout << std::endl

//-- for abnormal termination
#define ABORT abort

#endif  // _KCV_IO_H_

